package com.qq.service.impl;

import com.qq.dao.CarDao;
import com.qq.pojo.Car;
import com.qq.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CarServiceImpl implements CarService {

    @Autowired(required = false)
    private CarDao carDao;

    /**
     * 根据降序查询
     */
    @Override
    public List<Car> getAllCarsDESC() {
        return carDao.getAllCarsDESC();
    }

//    /**
//     *  根据升序查询
//     */
//    @Override
//    public List<Car> getAllCarsASC() {
//        return carDao.getAllCarsASC();
//    }

    /**
     *  根据订单数量排序
     */
    @Override
    public List<Car> getCarsByNum() {
        return carDao.getCarsByNum();
    }

    @Override
    public Car selectCarById(int id) {
        return carDao.selectCarById(id);
    }
}
